package com.foreknow.demo0927;

import java.util.Scanner;

public class Test {
    public static String[] m1(String[] array) {
        return array;
    }

    public static int m2(int i, int j) {
        int sum = i + j;
        System.out.println(sum);
        return sum;
    }

    public static double m2(double i, double j) {
        double sum = i + j;
        System.out.println(sum);
        return sum;
    }

    public static void m3() {
        Scanner sc = new Scanner(System.in);
        System.out.print("请输入姓名:");
        String name = sc.next();
        System.out.print("请输入年龄:");
        int age = sc.nextInt();
        System.out.print("请输入学校:");
        String school = sc.next();

        Person p1 = new Person();
        p1.setName(name);
        p1.setAge(age);
        p1.setSchool(school);

        System.out.println("你输入的学生信息是:");
        System.out.print("姓名:" + p1.getName() + "  ");
        System.out.print("年龄:" + p1.getAge() + "  ");
        System.out.print("学校:" + p1.getSchool() + "  ");
    }

    public static void m4(Person Person) {
        System.out.println("你输入的学生信息是:");
        System.out.print("姓名:" + Person.getName() + "--");
        System.out.print("年龄:" + Person.getAge() + "--");
        System.out.print("学校:" + Person.getSchool());
    }

    public static Person m5() {
        Person p = new Person();
        p.setName("1");
        p.setAge(12);
        p.setSchool("3");
        return p;
    }

    public static void main(String[] args) {
//        String[] arr = {"a", "b", "c", "d"};
//        String[] arr1 = Demo0927.m1(arr);
//        for (int i = 0; i < arr1.length; i++) {
//            System.out.println(arr1[i]);
//        }
//        m2(1,2);
//        m2(1.1,2.2);
//        m3();
//        Scanner sc = new Scanner(System.in);
//        System.out.print("请输入姓名:");
//        String name = sc.next();
//        System.out.print("请输入年龄:");
//        int age = sc.nextInt();
//        System.out.print("请输入学校:");
//        String school = sc.next();
//        Person0927 p1 = new Person0927();
//        p1.setName(name);
//        p1.setAge(age);
//        p1.setSchool(school);
//        m4(p1);
        Person p = Test.m5();
        System.out.println(p.getName());
    }
}
